using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class forums_controls_administration_AdminLink : System.Web.UI.UserControl
{
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Refresh();
        }
    }

    public void Refresh()
    {
        DAL.User myUser = Managers.UserLoginManager.CurrentUser;
        if (myUser != null && myUser.HasPermissions(DAL.User.UserStatus.Moderator))
        {
            this.Visible = true;
            lnkAdmin.NavigateUrl = Forum.SiteSettings.GetRelativePath("admin/default.aspx");
        }
        else
        {
            this.Visible = false;
        }
    }

    public string HeaderText
    {
        get
        {
            if (ViewState["HeaderText"] == null)
            {
                return ViewState["HeaderText"].ToString();
            }
            else
            {
                return "";
            }
        }
        set
        {
            ViewState["HeaderText"] = value;
        }
    }

    public string FooterText
    {
        get
        {
            if (ViewState["FooterText"] == null)
            {
                return ViewState["FooterText"].ToString();
            }
            else
            {
                return "";
            }
        }
        set
        {
            ViewState["FooterText"] = value;
        }
    }
}
